package com.etc.controller;

import com.etc.entity.Type;
import com.etc.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin("*")
public class TypeController {
    @Autowired
    private TypeService service;

    @GetMapping("type/{id}")
    public Type selectById(@PathVariable("id") int id){
        Type type = service.selectByPrimaryKey(id);
        return type;
    }



}
